﻿using System.Collections.Generic;
using Newtonsoft.Json;

namespace Hourglass.Qrobot.Models
{
    /// <summary>
    /// 请求返回的QQ群组Model
    /// </summary>
    public sealed class ReturnedGroups
    {
        /// <summary>
        /// 内容未知
        /// </summary>
        [JsonProperty("gmasklist")]
        public List<dynamic> Masks { get; set; }

        /// <summary>
        /// QQ群组
        /// </summary>
        [JsonProperty("gnamelist")]
        public List<Group> Names { get; set; }

        /// <summary>
        /// 内容未知
        /// </summary>
        [JsonProperty("gmarklist")]
        public List<dynamic> Marks { get; set; }

        public static ReturnedGroups EmptyNew()
        {
            return new ReturnedGroups
            {
                Masks = new List<dynamic>(),
                Names = new List<Group>(),
                Marks = new List<dynamic>()
            };
        }

        #region Internal Class

        public sealed class Group
        {
            [JsonProperty("gid")]
            public long Id { get; set; }

            [JsonProperty("flag")]
            public long Flag { get; set; }

            [JsonProperty("name")]
            public string Name { get; set; }

            [JsonProperty("code")]
            public long Code { get; set; } 
        }

        #endregion Internal Class
    }
}
